<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>福建农林大学-证明文件认证</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: #f5f5f5;
            min-height: 100vh;
        }

        .lang-switch {
            background-color: #ff4444;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            margin-bottom: 20px;
            float: right;
        }

        .container {
            padding: 25px;
            max-width: 400px;
            margin: 0 auto;
        }

        .cert-card {
            background: white;
            border-radius: 8px;
            padding: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            border: 2px dashed #4a90e2;
            text-align: center;
        }

        .logo-section {
            margin-bottom: 25px;
        }

        .logo {
            width: 100%;
            height: auto;
            display: block;
        }

        .verify-title {
            font-size: 24px;
            color: #4a90e2;
            margin: 25px 0;
            font-weight: bold;
            line-height: 1.3;
        }

        .info-section {
            text-align: left;
            margin: 25px 0;
        }

        .info-row {
            display: flex;
            margin-bottom: 12px;
            font-size: 14px;
            line-height: 1.5;
        }

        .info-label {
            color: #000;
            width: 120px;
            flex-shrink: 0;
            font-weight: bold;
            text-align: right;
            padding-right: 8px;
        }

        .info-value {
            color: #007AFF;
            flex: 1;
            padding-left: 5px;
        }

        .info-value.blue {
            color: #4a90e2;
        }

        .notice {
            color: #999;
            font-size: 12px;
            margin: 25px 0;
            line-height: 1.6;
            padding: 0 5px;
        }

        .detail-btn {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 6px;
            font-size: 16px;
            cursor: pointer;
            width: 100%;
            margin-top: 20px;
            line-height: 1.4;
        }

        .detail-btn:hover {
            background-color: #45a049;
        }

        .certificate-image-container {
            margin: 40px 0;
            text-align: center;
            padding: 20px 0;
        }

        .certificate-image {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: transform 0.3s ease;
        }

        .certificate-image:hover {
            transform: scale(1.02);
        }

        /* Image Modal styles */
        .image-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 1000;
        }

        .modal-content {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
            padding: 20px;
        }

        .modal-image {
            max-width: 90%;
            max-height: 90%;
            object-fit: contain;
            border-radius: 8px;
        }

        .close-btn {
            position: absolute;
            top: 20px;
            right: 30px;
            color: white;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            z-index: 1001;
        }

        .close-btn:hover {
            color: #ccc;
        }

        .hidden {
            display: none;
        }
    </style>
</head>
<body>
    <div class="container" id="mainContent">
        <button class="lang-switch" id="langSwitch" onclick="toggleLanguage()">English</button>
        <div style="clear: both;"></div>
        <div class="cert-card">
            <div class="logo-section">
                <img src="logo.JPG" alt="福建农林大学" class="logo">
            </div>
            
            <div class="verify-title" id="verifyTitle">验证通过</div>
            
            <div class="info-section">
                <div class="info-row">
                    <span class="info-label" id="studentLabel">学号/工号：</span>
                    <span class="info-value blue">000Q814228</span>
                </div>
                <div class="info-row">
                    <span class="info-label" id="nameLabel">姓名：</span>
                    <span class="info-value">张秋玉</span>
                </div>
                <div class="info-row">
                    <span class="info-label" id="docLabel">证明名称：</span>
                    <span class="info-value">在职证明</span>
                </div>
                <div class="info-row">
                    <span class="info-label" id="timeLabel">打印时间：</span>
                    <span class="info-value blue">2025-08-15<br>08:08:35</span>
                </div>
                <div class="info-row">
                    <span class="info-label" id="terminalLabel">打印终端：</span>
                    <span class="info-value blue">L3340000168</span>
                </div>
                <div class="info-row">
                    <span class="info-label" id="addressLabel">终端地址：</span>
                    <span class="info-value blue">福建农林大学明德楼</span>
                </div>
            </div>
            
            <div class="notice" id="notice">
                此证明材料真实有效，如果需要查看详细内容，请点击"查看详情"
            </div>
            
            <button class="detail-btn" onclick="window.open('detail.html', '_blank')">查看详情</button>
        </div>
    </div>

    <!-- Image Modal -->
    <div class="image-modal" id="imageModal" onclick="hideModal()">
        <div class="modal-content" onclick="event.stopPropagation()">
            <span class="close-btn" onclick="hideModal()">&times;</span>
            <img src="xiang_qingv1.jpg" alt="证明文件详情" class="modal-image">
        </div>
    </div>

    <script>
        let isEnglish = false;

        const translations = {
            zh: {
                langSwitch: 'English',
                verifyTitle: '验证通过',
                studentLabel: '学号/工号：',
                nameLabel: '姓名：',
                docLabel: '证明名称：',
                timeLabel: '打印时间：',
                terminalLabel: '打印终端：',
                addressLabel: '终端地址：',
                notice: '此证明材料真实有效，如果需要查看详细内容，请点击"查看详情"',
                detailBtn: '查看详情'
            },
            en: {
                langSwitch: '中文',
                verifyTitle: 'Verify Success',
                studentLabel: 'Student No./Job No:',
                nameLabel: 'Real Name:',
                docLabel: 'Document Title:',
                timeLabel: 'Print Time:',
                terminalLabel: 'Terminal:',
                addressLabel: 'Address:',
                notice: 'Valid document. Please click here for more information.',
                detailBtn: 'View Detail'
            }
        };

        function toggleLanguage() {
            isEnglish = !isEnglish;
            const lang = isEnglish ? 'en' : 'zh';
            
            // 如果切换到英文，添加历史记录状态
            if (isEnglish) {
                history.pushState({page: 'english'}, '', '');
            }
            
            updateLanguageDisplay(lang);
        }
        
        function updateLanguageDisplay(lang) {
            const langSwitchBtn = document.getElementById('langSwitch');
            langSwitchBtn.textContent = translations[lang].langSwitch;
            
            // 在英文页面时，"中文"按钮显示为绿色；在中文页面时，"English"按钮显示为红色
            if (isEnglish) {
                langSwitchBtn.style.backgroundColor = '#28a745';
                langSwitchBtn.style.color = 'white';
            } else {
                langSwitchBtn.style.backgroundColor = '#dc3545';
                langSwitchBtn.style.color = 'white';
            }
            
            document.getElementById('verifyTitle').textContent = translations[lang].verifyTitle;
            document.getElementById('studentLabel').textContent = translations[lang].studentLabel;
            document.getElementById('nameLabel').textContent = translations[lang].nameLabel;
            document.getElementById('docLabel').textContent = translations[lang].docLabel;
            document.getElementById('timeLabel').textContent = translations[lang].timeLabel;
            document.getElementById('terminalLabel').textContent = translations[lang].terminalLabel;
            document.getElementById('addressLabel').textContent = translations[lang].addressLabel;
            document.getElementById('notice').textContent = translations[lang].notice;
            document.getElementById('detailBtn').textContent = translations[lang].detailBtn;
        }



        function showModal() {
            document.getElementById('imageModal').style.display = 'block';
        }

        function hideModal() {
            document.getElementById('imageModal').style.display = 'none';
        }

        // 页面加载时初始化
        window.addEventListener('load', function() {
            // 确保弹窗初始状态为隐藏
            hideModal();
        });

        // 处理浏览器返回按钮
        window.addEventListener('popstate', function(event) {
            if (event.state && event.state.language) {
                const isEnglish = event.state.language === 'en';
                document.body.classList.toggle('english', isEnglish);
            } else if (event.state && event.state.modal === 'open') {
                // 如果是弹窗状态，不做任何处理，让弹窗保持打开
            } else {
                // 默认中文，关闭弹窗
                document.body.classList.remove('english');
                hideModal();
            }
        });

        </script>
</body>
</html>